<html>
<head><meta charset="utf-8"><title>Remaining memory leak? · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html">Remaining memory leak?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="232816545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232816545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232816545">(Apr 01 2021 at 20:02)</a>:</h4>
<p>r-a is currently sitting at &gt;4GB RAM usage (built from git), it seems like we might have another memory usage issue/leak somewhere?</p>
<p>leak sanitizer doesn't report anything</p>



<a name="232821590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232821590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232821590">(Apr 01 2021 at 20:39)</a>:</h4>
<p>7.3 GB, and I haven't done much, this is growing very fast</p>



<a name="232821663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232821663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232821663">(Apr 01 2021 at 20:40)</a>:</h4>
<p>looking at the commit history I can't see anything suspicious since the token text leak was fixed</p>



<a name="232824295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232824295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232824295">(Apr 01 2021 at 21:00)</a>:</h4>
<p>nevermind, for some reason my VS Code config was broken and still used the old version, not my local build</p>



<a name="232831220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232831220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232831220">(Apr 01 2021 at 22:01)</a>:</h4>
<p>no, that wasn't it, it's still leaking like crazy, but only when actively editing code maybe?</p>



<a name="232831630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232831630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232831630">(Apr 01 2021 at 22:04)</a>:</h4>
<p>uuh, the "Show RA Version" command changes when I recompile, even without restarting the server, that's confusing</p>



<a name="232832102"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232832102" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232832102">(Apr 01 2021 at 22:09)</a>:</h4>
<p>hmm, I thought it was the global interning PR, but it seems like it doesn't always reproduce immediately</p>



<a name="232832130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232832130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232832130">(Apr 01 2021 at 22:09)</a>:</h4>
<p>when it does happen, parsing diagnostics take quite a while to show up</p>



<a name="232876947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232876947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232876947">(Apr 02 2021 at 09:00)</a>:</h4>
<p>I'm also seeing this with RA open against a bunch of rustc code, is there anything I can do to help debug?</p>



<a name="232879375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232879375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232879375">(Apr 02 2021 at 09:31)</a>:</h4>
<p>:O I can't seem to find the RA version in the log output. this seems <em>very</em> surprising as an omission, unless I accidentally turned off the requisite item or something</p>



<a name="232879446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232879446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232879446">(Apr 02 2021 at 09:32)</a>:</h4>
<p>The binary is here <a href="https://rust-analyzer.github.io/manual.html#vs-code">https://rust-analyzer.github.io/manual.html#vs-code</a>, run it with <code>--version</code></p>



<a name="232880507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232880507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232880507">(Apr 02 2021 at 09:46)</a>:</h4>
<p>"nightly" :O well, hm, hahaha</p>



<a name="232880974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232880974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232880974">(Apr 02 2021 at 09:50)</a>:</h4>
<p>That might be an older version</p>



<a name="232880990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232880990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232880990">(Apr 02 2021 at 09:51)</a>:</h4>
<p>What's the file date?</p>



<a name="232880998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232880998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232880998">(Apr 02 2021 at 09:51)</a>:</h4>
<p>Its birth time was March 31</p>



<a name="232881012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232881012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232881012">(Apr 02 2021 at 09:51)</a>:</h4>
<p>not sure how I can ask it with Coc</p>



<a name="232881095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232881095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232881095">(Apr 02 2021 at 09:52)</a>:</h4>
<p>That's strange. There was a bug, but it was fixed in <a href="https://github.com/rust-analyzer/rust-analyzer/pull/8194">https://github.com/rust-analyzer/rust-analyzer/pull/8194</a></p>



<a name="232881112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232881112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232881112">(Apr 02 2021 at 09:52)</a>:</h4>
<p>And the latest nightly says <code>rust-analyzer nightly-11-gea8feca31</code></p>



<a name="232881153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232881153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232881153">(Apr 02 2021 at 09:53)</a>:</h4>
<p>If your server binary is older than that, it probably doesn't have <a href="https://github.com/rust-analyzer/rust-analyzer/pull/8191">https://github.com/rust-analyzer/rust-analyzer/pull/8191</a></p>



<a name="232881259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232881259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232881259">(Apr 02 2021 at 09:54)</a>:</h4>
<p>hm. weird. filed <a href="https://github.com/rust-analyzer/rust-analyzer/pull/8291">https://github.com/rust-analyzer/rust-analyzer/pull/8291</a> because it would be good to have it in the logs</p>



<a name="232881304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232881304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232881304">(Apr 02 2021 at 09:55)</a>:</h4>
<p>I'll try to figure out what coc-rust-analyzer is doing here... actually, maybe it's on a release version</p>



<a name="232881602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232881602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232881602">(Apr 02 2021 at 09:59)</a>:</h4>
<p>alright, can still repro the nasty leak on rust-analyzer nightly-11-gea8feca31</p>



<a name="232882675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232882675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232882675">(Apr 02 2021 at 10:11)</a>:</h4>
<p>hmmm i may have a consistent repro that may be transferable to someone else more familiar with RA innards (and for whom it is not 3am haha). </p>
<p>Try opening rust/compiler/rustc_span/src/symbol.rs (i have rev <a href="https://github.com/rust-lang/rust/commit/2a32abbcdea97c6bf1d0445bc657f16c50ca103b">2a32abbcdea97c6bf1d0445bc657f16c50ca103b</a> on my computer)</p>



<a name="232882742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232882742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232882742">(Apr 02 2021 at 10:12)</a>:</h4>
<p>that seems to be the file that was causing it in my nvim session file. also repros in code with just that file open</p>



<a name="232882763"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232882763" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232882763">(Apr 02 2021 at 10:12)</a>:</h4>
<p>so something in that triggers the mem leak, I hope, not just on my computer, but also on others'</p>



<a name="232884708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232884708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232884708">(Apr 02 2021 at 10:35)</a>:</h4>
<p>presently bisecting it</p>



<a name="232886361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232886361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232886361">(Apr 02 2021 at 10:58)</a>:</h4>
<p>argh, still was in the rev from the 29th. going to go and try something real old, bleh</p>



<a name="232889301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232889301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232889301">(Apr 02 2021 at 11:37)</a>:</h4>
<p><span aria-label="scream" class="emoji emoji-1f631" role="img" title="scream">:scream:</span> it seems like it is maybe 90% reproducible rather than 100% reproducible. wonder if i had some bad revs marked good :///</p>



<a name="232891929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232891929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232891929">(Apr 02 2021 at 12:11)</a>:</h4>
<p>ok I'm going to bed because I'm extremely tired and also Nvidia crashed my computer again. it's something in the vicinity of b4c20e358, according to my bisecting</p>



<a name="232941569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232941569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232941569">(Apr 02 2021 at 19:30)</a>:</h4>
<p>This can be reproduced by having <code>hir_expand/src/name.rs</code> open in an editor. r-a takes a long time to compute diagnostics for that due to a known bug, but it also seems to be leaking (a lot of) memory somewhere.</p>



<a name="232941629"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232941629" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232941629">(Apr 02 2021 at 19:30)</a>:</h4>
<p>the known bug is tracked in <a href="https://github.com/rust-analyzer/rust-analyzer/issues/8268">https://github.com/rust-analyzer/rust-analyzer/issues/8268</a></p>



<a name="232943353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232943353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232943353">(Apr 02 2021 at 19:48)</a>:</h4>
<p>with <code>--features jemalloc</code>, memory doesn't seem to ever climb beyond 3 GB</p>



<a name="232943362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232943362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232943362">(Apr 02 2021 at 19:48)</a>:</h4>
<p>cursed. why are computers.</p>



<a name="232943438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232943438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232943438">(Apr 02 2021 at 19:48)</a>:</h4>
<p>after running the memory usage command it outputs "644mb Remaining", so I think there's still <em>something</em> odd going on maybe? but it doesn't seem to increase indefinitely anymore</p>



<a name="232943642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232943642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232943642">(Apr 02 2021 at 19:50)</a>:</h4>
<p>hmm, and that command really does recycle almost all the memory</p>



<a name="232943663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232943663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232943663">(Apr 02 2021 at 19:50)</a>:</h4>
<p>that didn't really happen without jemalloc</p>



<a name="232955166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232955166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232955166">(Apr 02 2021 at 21:35)</a>:</h4>
<p>how does changing the allocator make it not leak indefinitely anymore? <span aria-label="scream" class="emoji emoji-1f631" role="img" title="scream">:scream:</span> cursed sand machine</p>



<a name="232980648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232980648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232980648">(Apr 03 2021 at 04:44)</a>:</h4>
<p>hm, so I checked again, and the version prior to <a href="https://github.com/rust-analyzer/rust-analyzer/commit/b4c20e3589372ba1536cec1bfe7de6acd2f40a4d">https://github.com/rust-analyzer/rust-analyzer/commit/b4c20e3589372ba1536cec1bfe7de6acd2f40a4d</a> does not leak rapidly whereas it seems like versions starting with that commit do leak on my repro.</p>



<a name="232980653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232980653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232980653">(Apr 03 2021 at 04:44)</a>:</h4>
<p>ah, hmm. <a href="/user_uploads/4715/gG1CsGyw3VRLa3LGeNhwW1dn/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/gG1CsGyw3VRLa3LGeNhwW1dn/image.png" title="image.png"><img src="/user_uploads/4715/gG1CsGyw3VRLa3LGeNhwW1dn/image.png"></a></div>



<a name="232980667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232980667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232980667">(Apr 03 2021 at 04:45)</a>:</h4>
<p>so uh this little guy leaked 42mb + several several more instances of the same :D little leak that could</p>



<a name="232981281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232981281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jade <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232981281">(Apr 03 2021 at 04:59)</a>:</h4>
<p>(since been removed, different source I imagine now? unsure)</p>



<a name="232988022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232988022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232988022">(Apr 03 2021 at 07:20)</a>:</h4>
<p>That was <a href="https://github.com/rust-analyzer/rust-analyzer/pull/8191">https://github.com/rust-analyzer/rust-analyzer/pull/8191</a></p>



<a name="232988092"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/232988092" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#232988092">(Apr 03 2021 at 07:22)</a>:</h4>
<p><span class="user-mention silent" data-user-id="325709">Jade</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Remaining.20memory.20leak.3F/near/232955166">said</a>:</p>
<blockquote>
<p>how does changing the allocator make it not leak indefinitely anymore? <span aria-label="scream" class="emoji emoji-1f631" role="img" title="scream">:scream:</span> cursed sand machine</p>
</blockquote>
<p>Sometimes it's not a leak, it's fragmentation or an allocation pattern that the allocator barfs on.</p>



<a name="233019451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Remaining%20memory%20leak%3F/near/233019451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Remaining.20memory.20leak.3F.html#233019451">(Apr 03 2021 at 17:20)</a>:</h4>
<p>I've been using a jemalloc-enable rust-analyzer for development yesterday and RAM usage hasn't climbed much beyond 3 GB in the worst case. Currently sitting at 2.6 GB. I guess this really is just hitting a bad allocation pattern for the glibc allocator then.</p>
<p>In that case, implementing lazy diagnostic fixes should resolve this.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>